//package org.rain.core.mp.interceptor;
//
//import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper;
//import com.baomidou.mybatisplus.core.toolkit.PluginUtils;
//import com.baomidou.mybatisplus.extension.parser.JsqlParserSupport;
//import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor;
//import net.sf.jsqlparser.expression.Expression;
//import net.sf.jsqlparser.statement.delete.Delete;
//import net.sf.jsqlparser.statement.insert.Insert;
//import net.sf.jsqlparser.statement.select.PlainSelect;
//import net.sf.jsqlparser.statement.select.Select;
//import net.sf.jsqlparser.statement.update.Update;
//import org.apache.ibatis.executor.Executor;
//import org.apache.ibatis.mapping.BoundSql;
//import org.apache.ibatis.mapping.MappedStatement;
//import org.apache.ibatis.session.ResultHandler;
//import org.apache.ibatis.session.RowBounds;
//import org.springframework.stereotype.Component;
//
//import java.sql.SQLException;
//
///**
// * created by yangtong on 2024/5/17 13:49
// *
// * @Description: 数据权限过滤器
// */
//@Component
//public class DataPermissionInterceptor extends JsqlParserSupport implements InnerInterceptor {
//
//
//    @Override
//    public void beforeQuery(Executor executor, MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
//        if (InterceptorIgnoreHelper.willIgnoreDataPermission(ms.getId())) {
//            return;
//        }
////        PluginUtils.MPBoundSql mpBs = PluginUtils.mpBoundSql(boundSql);
////        mpBs.sql(this.parserSingle(mpBs.sql(), ms.getId()));
//        PluginUtils.MPBoundSql mpBs = PluginUtils.mpBoundSql(boundSql);
//        mpBs.sql("select id from sys_user");
//    }
//
//    /**
//     * 实现JsqlParserSupport的四个方法
//     */
//    @Override
//    protected void processSelect(Select select, int index, String sql, Object obj) {
//        PlainSelect plainSelect = (PlainSelect)select.getSelectBody();
//        Expression whereClause = plainSelect.getWhere();
//    }
//
//    @Override
//    protected void processInsert(Insert insert, int index, String sql, Object obj) {
//
//    }
//
//    @Override
//    protected void processUpdate(Update update, int index, String sql, Object obj) {
//
//    }
//
//    @Override
//    protected void processDelete(Delete delete, int index, String sql, Object obj) {
//
//    }
//}
